/*
 * Copyright (C) 2020-present, kinbug All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.gitee.kinbug.sniper.indicator;

import java.math.BigDecimal;
import java.util.List;

/**
 * -Boll 布林线指标
 * @ClassName: BollIndicator
 * @author kinbug
 * @date 2020-11-20
 */
public class BollIndicator {
  
	/**
	 * -获取中轨线
	 * @Title: getMBValue
	 * @param  list 求boll的源数据
	 * @return BigDecimal 返回对应的MB
	 * @throws
	 */
	public static BigDecimal getMbValue(List<BigDecimal> list) {
		return SMAIndicator.getValue(list,list.size());
	}
	
	/**
	 * -获取上轨线
	 * @Title getUPValue
	 * @param list 求boll的源数据
	 * @param MBValue 中轨值(等于MA)
	 * @param mom 倍数指标
	 * @return BigDecimal 返回对应的MB
	 * @throws
	 */
	public static BigDecimal getUpValue(List<BigDecimal> list,BigDecimal MBValue, BigDecimal mom) {
		return MBValue.add(mom.multiply(StandardDeviationIndicator.getValue(list, MBValue)));
	}
	
	/**
	 * -获取下轨线
	 * @Title getDNValue
	 * @param list 求boll的源数据
	 * @param MBValue 中轨值(等于MA)
	 * @param mom 倍数指标
	 * @return BigDecimal 返回对应的MB
	 * @throws
	 */
	public static BigDecimal getDnValue(List<BigDecimal> list,BigDecimal MBValue, BigDecimal mom) {
		return MBValue.subtract(mom.multiply(StandardDeviationIndicator.getValue(list, MBValue)));
	}
}
